count number of rows in table using javascript